﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualBasic;

namespace Global
{
    public static class Validator
    {
        public static bool IsNumeric(string text)
        {
            return Microsoft.VisualBasic.Information.IsNumeric(text);
        }

        public static bool IsValidNumber(string text)
        {
            if (IsNumeric(text) == false)
                return false;

            int number;
            try
            {
                number = Int32.Parse(text);
            }
            catch (Exception ex)
            {
                return false;
            }

            if (number <= 0 || number > Int32.MaxValue)
                return false;

            return true;
        }
    }
}
